<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<script>
//计算 1 + 2 + 3 +.... + 99 + 100
/*var sum = 0;
 for(var i = 1; i < 9910001; i++){
 sum = sum + i;
 }
 console.log(sum);*/
//计算1-10000之间能同时被3和5整除的所有整数的和
var sum = 0;
/*for (var i = 1; i < 1000; i++){
 if (i % 3 == 0 || i % 5 == 0){
 sum += i;
 }
 }
 console.log(sum);*/
// 计算 20! = 20*19*18*...*2*1
var ji = 1;
for (var i = 20; i > 0; i--){
    ji *= i;
}
console.log(ji);
</script>
</body>
</html>